
#ifndef MEDIALIST_H
#define MEDIALIST_H

#include <QObject>
#include "../mediaplayer/mplayer.h"
#include "environment.h"

extern QString g_installPath;

class medialist : public QObject
{
    Q_OBJECT
public:
    explicit medialist(uint number = 0, QObject *parent = 0);
    ~medialist();

    void initList();
    void getCurTimePos();
    void seekToTimePos(const float seconds);


    void updateList(const RoutePkgStruct& routePkg);
    void nextToPlay(const RoutePkgStruct& routePkg);


    void hide();
    void show();
    void isHide();

    bool isRunning();
    bool isStop();
    void stop();
    void closePlay();

signals:
    void msgArrive(uint typeID, uint number, long msg = 0);
    void mplayerTimePos(const float seconds);
    void mediaPlayEnd();

public slots:
    void medialistfinish();
    void timeToStop();

private:
    mplayer*        m_pMPlayer;//这里不应是一个，当有多个视频时 //应当是一个，每个包对应一列表控制
    QList<QString>  m_fileList;
    int             m_nCur;
    int             m_nNumber;

    QList<int>      m_playTimeList;  //视频允许播放的时间
    QTimer*         m_playTimer; //视频播放时间定时器
    bool            m_isPlayFinish; //播放时间到了的标志


    bool            m_isClosePlay;

    QList<LayoutStruct>    layoutList;


//    QObject         *m_pMainWnd;
};

#endif // MEDIALIST_H
